<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>不完全解构</title>

    <script>
        // 代码1：不完全解构
        let [x, y] = [1, 2, 3];
        console.log(x, y);// 1 2

        // 代码2：嵌套数组不完全解构
        let [a, [b], c] = [1, [2, 3], 4];
        console.log(a, b, c);// 1 2 4
        
        // 代码3：跳过元素
        let [i, , j] = [1, 2, 3];// 不完全解构，=元素2会被跳过
        console.log(i, j);// 1 3
    </script>
</head>
<body>
    
</body>
</html>